<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:composite="http://java.sun.com/jsf/composite"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:zanata="http://java.sun.com/jsf/composite/zanata">

<composite:interface>
  <composite:attribute name="value" type="org.zanata.model.Activity"
    shortDescription="activity" required="true"/>

  <composite:attribute name="hideInfo" type="java.lang.Boolean"
    shortDescription="add 'reveal__target' class to information which will be hidden by default"
    default="false"/>
</composite:interface>

<composite:implementation>
  <p class="l--float-right txt--neutral l--push-left-half">
    <i
      class="i--large #{activityEntry.getActivityTypeIconClass(cc.attrs.value)}"
      title="#{activityEntry.getActivityTitle(cc.attrs.value)}"></i>
    <span class="is-invisible">#{activityEntry.getActivityTitle(cc.attrs.value)}</span>
  </p>

  <ui:param name="isVersionDeleted" value="#{activityEntry.isVersionDeleted(cc.attrs.value)}"/>
  <ui:param name="canViewProject" value="#{activityEntry.canViewProject(activity)}"/>

  <p class="l--push-all-0">
    <h:outputText escape="false"
      value="#{activityEntry.getActivityMessage(activity)}"/>
  </p>

  <ul class="list--horizontal txt--meta">
    <li>
      <i  class="i i--clock txt--neutral"
        title="#{msgs['jsf.Time']}"></i>
      <span
        class="is-invisible">#{msgs['jsf.Time']}</span>#{activityEntry.getHowLongAgoDescription(cc.attrs.value)}
    </li>
    <ui:param name="docName"
      value="#{activityEntry.getDocumentName(cc.attrs.value)}"/>
    <ui:fragment rendered="#{docName != null and !docName.isEmpty()}">
      <li class="#{cc.attrs.hideInfo ? 'reveal__target': ''}">
        <ui:fragment rendered="#{not isVersionDeleted and canViewProject}">
          <a class="bx--break-all bx--block"
            href="#{activityEntry.getDocumentUrl(cc.attrs.value)}">
            <i  class="i i--document txt--neutral l--push-right-quarter"
              title="#{msgs['jsf.Document']}"></i>
            <span class="is-invisible">#{msgs['jsf.Document']}</span>
            #{docName}
          </a>
        </ui:fragment>
        <h:panelGroup layout="block" styleClass="bx--break-all" rendered="#{isVersionDeleted or not canViewProject}">
          <i  class="i i--document txt--neutral l--push-right-quarter"
            title="#{msgs['jsf.Document']}"></i>
          <span class="is-invisible">#{msgs['jsf.Document']}</span>
          <span class="txt--neutral">#{docName}</span>
        </h:panelGroup>
      </li>
    </ui:fragment>
    <ui:param name="languageName"
      value="#{activityEntry.getLanguageName(cc.attrs.value)}"/>
    <ui:fragment
      rendered="#{languageName != null and !languageName.isEmpty()}">
      <li class="#{cc.attrs.hideInfo ? 'reveal__target': ''}">
        <i  class="i i--language txt--neutral"
          title="#{msgs['jsf.Language']}"></i>
        <span class="is-invisible">#{msgs['jsf.Language']}</span>
        <ui:fragment rendered="#{not isVersionDeleted and canViewProject}">
          <a
            href="#{activityEntry.getDocumentListUrl(cc.attrs.value)}">#{languageName}</a>
        </ui:fragment>
        <ui:fragment rendered="#{isVersionDeleted or not canViewProject}">
          <span class="txt--neutral">#{languageName}</span>
        </ui:fragment>
      </li>
    </ui:fragment>
    <ui:param name="versionName"
      value="#{activityEntry.getVersionName(cc.attrs.value)}"/>
    <ui:fragment
      rendered="#{versionName != null and !versionName.isEmpty()}">
      <li class="#{cc.attrs.hideInfo ? 'reveal__target': ''}">
        <i  class="i i--version txt--neutral"
          title="#{msgs['jsf.Version']}">
          <span class="is-invisible">#{msgs['jsf.Version']}</span>
        </i>
        <ui:fragment rendered="#{not isVersionDeleted and canViewProject}">
          <a href="#{activityEntry.getVersionUrl(cc.attrs.value)}">
            <zanata:version-label version="#{activityEntry.getVersion(cc.attrs.value)}"/>
          </a>
        </ui:fragment>
        <ui:fragment rendered="#{isVersionDeleted or not canViewProject}">
          <span class="txt--neutral">
            <zanata:version-label version="#{activityEntry.getVersion(cc.attrs.value)}" showIcon="false"/>
          </span>
        </ui:fragment>
      </li>
    </ui:fragment>
  </ul>
</composite:implementation>
</html>
